// request.js
export function request({ url, method = 'GET', data = {}, headers = {} }) {
  return new Promise((resolve, reject) => {
    wx.request({
      url: 'http://localhost:8085' + url,
      method,
      data,
      header: headers,
      success: (res) => {
        resolve(res.data); // 假设后端统一返回 { code, msg, data }
      },
      fail: reject
    });
  });
}
